package com.sokal.easycare.modules.order.entity.capital;

import org.hibernate.validator.constraints.Length;

import com.sokal.easycare.modules.order.entity.track.OmOrderTrack;
import com.sokal.easycare.modules.sys.entity.MainUser;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 用户质保金Entity
 * @author lihaipei
 * @version 2017-05-26
 */
public class PersonCapital extends DataEntity<PersonCapital> {
	
	private static final long serialVersionUID = 1L;
	private String status;		// 状态
	private Double money;		// 冻结金额
	private MainUser owner;		// 所属人
	private Date freezeTime;		// 冻结时间
	private Date thawTime;		// 解冻时间
	private OmOrderTrack orderTrack;		// 工单关联
	
	public PersonCapital() {
		super();
	}

	public PersonCapital(String id){
		super(id);
	}

	public PersonCapital(Date freezeTime) {
		super();
		this.freezeTime = freezeTime;
	}

	public PersonCapital(MainUser owner, String status) {
		this.owner = owner;
		this.status = status;
	}

	@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}
	
	public MainUser getOwner() {
		return owner;
	}

	public void setOwner(MainUser owner) {
		this.owner = owner;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getFreezeTime() {
		return freezeTime;
	}

	public void setFreezeTime(Date freezeTime) {
		this.freezeTime = freezeTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getThawTime() {
		return thawTime;
	}

	public void setThawTime(Date thawTime) {
		this.thawTime = thawTime;
	}

	public OmOrderTrack getOrderTrack() {
		return orderTrack;
	}

	public void setOrderTrack(OmOrderTrack orderTrack) {
		this.orderTrack = orderTrack;
	}
	
	public static final String STATUS0_ = "0";
	public static final String STATUS1_ = "1";
}